pull: ref the thread default main context during init, unref in cleanup
authorVivek Dasmohapatra <vivek@collabora.co.uk>
Mon, 9 Sep 2013 14:54:26 +0000 (15:54 +0100)
committerColin Walters <walters@verbum.org>
Mon, 9 Sep 2013 16:06:01 +0000 (12:06 -0400)
...get_thread_default returns NULL when the thread default is also the global
default, so this only shows up when running in a thread (eg g_task_run_in_thread)

src/libostree/ostree-repo-pull.c

index 81d4891e5eb0d52b6098944cad6fdc9bbec3ea2d..ca9b017c83ee3a64a40ff8b542f5e30d12d36930 100644 (file)
@@ -1148,7 +1148,7 @@ ostree_repo_pull (OstreeRepo               *self,
   guint64 end_time;
 
   pull_data->async_error = error;
-  pull_data->main_context = g_main_context_get_thread_default ();
+  pull_data->main_context = g_main_context_ref_thread_default ();
   pull_data->loop = g_main_loop_new (pull_data->main_context, FALSE);
   pull_data->flags = flags;